package org.contextsensitivetodo.contextdetails;

import org.contextsensitivetodo.R;
import org.contextsensitivetodo.context.UserContext;
import org.contextsensitivetodo.context.configuration.UserContextConfiguration;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

public class ViewUserContextDetailsActivity extends Activity {

	// Called when the activity is first created.
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.usercontextdetails);
		Intent intent = getIntent();
		String contextName = intent.getStringExtra("usercontext");
		
		TextView contextDetails = (TextView) findViewById(R.id.ContextDetailsText);
		UserContext userContext = UserContextConfiguration.getInstance().getUserContextByName(contextName);
		if(userContext != null){
			contextDetails.setText(userContext.toString());
		}else{
			contextDetails.setText(contextName + ", unknown context.");
		}
	}
	
}
